/****************************************************
          File Name:msg.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Thu 11 Sep 2014 09:57:32 AM CST
*****************************************************/
#ifndef msg_h_
#define msg_h_
#include<stdio.h>
#include<sys/types.h>
#include<sys/ipc.h>
#include<sys/msg.h>
#include<errno.h>
#include<stdlib.h>
#include<unistd.h>
#define DATA_SIZE 500
#define PATH "./msg.h"
#define key 0xaaaa0309

void err(char *fun)
{
    perror(fun);
    exit(errno);
}

struct msgbuf {
    long mtype;     /* message type, must be > 0 */
    long id;        /* use in server-client stand for msgid */
    char mtext[DATA_SIZE];  /* message data */
};

#endif
